﻿using System;
using System.Reflection;

namespace Moonlite.Data.Configuration
{
    /// <summary>
    /// Provides helper methods for getting a <see cref="System.Reflection.Assembly"/>'s file path.
    /// </summary>
    internal static class AssemblyPathHelpers
    {
        /// <summary>
        /// Gets the assembly's file path.
        /// </summary>
        /// <param name="assembly">The assembly.</param>
        /// <returns>The assembly's file path.</returns>
        public static string GetAssemblyPath(Assembly assembly)
        {
            string file = (new Uri(assembly.CodeBase.Replace("#", "%23")).LocalPath);
            return file;
        }
    }
}
